org 100h

mov si, 0

start:
cmp si, 0
jne next
lea bx, arr
dec si
mov dx, num
mov [bx][si] + 1, dx
inc si
jmp new
next:
dec si
mov bx, arr[si]
inc bx
inc si
mov arr[si], bx
new:
mov cx, arr[si]
call outCx
inc si
cmp si, 10
je end
jmp start
end:
int 20h

arr db 10 dup(0)
num dw 3

outCx proc
cmp cx, 0
je isZero
lea dx, notzero
mov ah, 09h
int 21h
lea dx, newline
mov ah, 09h
int 21h
push cx
c:
	call output
loop c
lea dx, newline
mov ah, 09h
int 21h
pop cx
ret
isZero:
lea dx, zero
mov ah, 09h
int 21h
lea dx, newline
mov ah, 09h
int 21h
ret
zero db 'zero$'
notzero db 'not zero$'
outCx endp

output proc
lea dx, str
mov ah, 09h
int 21h
ret
str db 'I$'
output endp

newline db 13
db 10
db '$'
